package cn.cjj.gulimall.order.vo;

import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author CuiJunJie
 * @create 2021/7/8-20:54
 */
@Data
public class OrderItemVo {
    private Long skuId;
    private String title;
    private String image;
    private List<String> skuAttr;
    private BigDecimal price;
    private Integer count;
    private BigDecimal totalPrice;
    private boolean hasStock;
    private int weight;

    public BigDecimal getTotalPrice() {
        if (price != null && count != null) {
            return price.multiply(new BigDecimal(count.toString()));
        }

        return new BigDecimal("0");
    }

}
